﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace CorporationWars
{
    [Serializable]
    public class SectorExit
    {
        public Vector3 Position { get; set; }
        public string Name { get; set; }

        public Matrix world { get { return Matrix.CreateTranslation(Position); } }
        public BoundingBox Bounds { get { return new BoundingBox(Vector3.Transform(-Vector3.One, world), Vector3.Transform(Vector3.One, world)); } }

        public SectorExit(string name, Vector3 position)
        {
            Position = position;
            Name = name;
        }

        public void Draw(Game1 game, GameTime gameTime)
        {
            game.DrawMesh(game.Content.Load<Model>("Models/Block"), Matrix.CreateTranslation(Position), "OutsideRender", Color.White);
            Vector2 exitTextPos = Game1.Get2DCoords(Position, game.camera);
            string extText = string.Format("To Sector: {0}", Name);
            exitTextPos.X -= game.Content.Load<SpriteFont>("Fonts/Font").MeasureString(extText).X / 2;
            game.RenderText(extText, exitTextPos, Color.Plum);
        }
    }
}
